(function() {
	$.dataReader = {
		getList : function(postData, reportId, callBack) {// 读取list

			var url = jsContextPath + '/dataReader/getDataList.do';
			var callBack_ = function(data) {
				var dataList = data.dataList || [];
				if ($.isFunction(callBack)) {
					callBack(dataList);
				}
			}
			doDataRead(url, reportId, postData, callBack_);
		},
		getObject : function(postData, reportId, callBack) {// 读取object

			var url = jsContextPath + '/dataReader/getDataObj.do';

			var callBack_ = function(data) {
				var dataObj = data.dataObj || {};
				if ($.isFunction(callBack)) {
					callBack(dataObj);
				}
			}
			doDataRead(url, reportId, postData, callBack_);
		}
	};

	/**
	 * 读取后台数据
	 */
	function doDataRead(url, reportId, postData, callBack) {
		postData = postData || {};
		postData.sqlId = reportId;
		$.ajax( {
			url : url,
			type : 'post',
			data : postData,
			dataType : 'json',
			success : function(data, stauts, XHR) {
				callBack(data);
			}
		});
	}
	;

})();